package com.kecheng.xinmei.service.impl;

import com.kecheng.xinmei.dao.AdminDao;
import com.kecheng.xinmei.entity.*;
import com.kecheng.xinmei.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author gaokecheng
 * @version 1.0
 * @date 2020/11/20 4:21 下午
 */
@Service
public class AdminServiceImpl  implements AdminService {

    @Autowired
    private AdminDao adminDao;
    @Override
    public Boolean addDoctor(Doctor doctor) {
        if(adminDao.addDoctor(doctor)<1){
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }
    public Boolean updateDoctor(Doctor doctor) {
        if(adminDao.updateDoctor(doctor)<1){
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }

    @Override
    public Boolean addLunbo(Lunbo lunbo) {
        if(adminDao.addLunbo(lunbo)<1){
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }

    @Override
    public Boolean deleteLunbo(Integer id) {
        if(adminDao.deleteLunbo(id)<1){
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }

    @Override
    public Boolean addTopic(Topic topic) {
        if(adminDao.addTopic(topic)<1){
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }

    @Override
    public Boolean updateTopic(Topic topic) {
        if(adminDao.updateTopic(topic)<1){
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }

    @Override
    public Boolean addLife(Life life) {
        if(adminDao.addLife(life)<1){
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }

    @Override
    public Boolean updateLife(Life life) {
        if(adminDao.updateLife(life)<1){
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }

    @Override
    public Boolean addPerson(Person person) {
        if(adminDao.addPerson(person)<1){
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }

    @Override
    public Boolean deletePerson(Integer id) {
        if(adminDao.deletePerson(id)<1){
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }

    @Override
    public Boolean updateIntroduction(Introduction introduction) {
        if(adminDao.updateIntroduction(introduction)<1){
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }

    @Override
    public Boolean deleteIntroduction(Integer id) {
        if(adminDao.deleteIntroduction(id)<1){
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }

    @Override
    public Boolean addNews(News news) {
        Boolean flag = Boolean.TRUE;
        if(adminDao.addNews(news)<1){
                    flag = Boolean.FALSE;
                }

        return flag;
    }

    @Override
    public Boolean deleteNews(Integer id) {
        if(adminDao.deleteNews(id)<1){
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }

    @Override
    public Boolean addResult(Result result) {
        if(adminDao.addResult(result)<1){
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }

    @Override
    public Boolean deleteResult(Integer id) {
        if(adminDao.deleteResult(id)<1){
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }
}
